package com.dong.design.observer.java;

import java.util.Observable;
import java.util.Observer;

/**
 * @author jianyang206881
 * @date 2018/6/27
 */
public class BObserver implements Observer {
    public BObserver(ServerManager sm) {
        super();
        //注册加入观察者
        sm.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("BObserver receive:Data has changed to " + ((ServerManager) o).getData());
    }
}
